<!--{template header,admin}-->
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/admin.js" type="text/javascript"></script>
<script src="js/calendar.js" type="text/javascript"></script>
<div style="width:100%; height:15px;color:#000;margin:0px 0px 10px;">
  <div style="float:left;"><a href="index.php?admin_main/stat{$setting['seo_suffix']}" target="main"><b>控制面板首页</b></a>&nbsp;&raquo;&nbsp;用户管理</div>
</div>
<!--{if isset($message)}-->
<!--{eval $type=isset($type)?$type:'correctmsg'; }-->
<table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
	<tr>
		<td class="{$type}">{$message}</td>
	</tr>
</table>
<!--{/if}-->
<form action="index.php?admin_user/search{$setting['seo_suffix']}" method="post">
<table width="100%" cellspacing="1" cellpadding="4" align="center" class="tableborder">
	<tbody>
	<tr class="header" ><td colspan="7">用户列表&nbsp;&nbsp;&nbsp;<input type="button" sytle="cursor:pointer" onclick="document.location.href='index.php?admin_user/add{$setting['seo_suffix']}'" value="添加用户" /></td></tr>
	<tr class="altbg1"><td colspan="7">可以通过如下搜索条件，检索用户</td></tr>
	<tr>
        <td width="20%" >用户名:<input class="txt" name="srchname"></td>
        <td  width="20%">UID:<input class="txt" name="srchuid"></td>
        <td  width="20%">Email:<input class="txt" name="srchemail"></td>
        <td  rowspan="2"><input class="btn" type="submit" value="提 交"></td>
   </tr>
   <tr>
        <td  width="20%">注册日期:<input class="txt" onclick="showcalendar();" name="srchregdatestart"></td>
        <td  width="20%">到<input class="txt" onclick="showcalendar();" name="srchregdateend"></td>
        <td  width="20%">注册IP:<input class="txt" name="srchregip"></td>
   </tr>
	</tbody>
</table>
</form>
<form name="userForm" action="index.php?admin_user/remove{$setting['seo_suffix']}" method="post">
 <table width="100%" border="0" cellpadding="4" cellspacing="1" class="tableborder">
	<tr class="header">
		<td width="10%"><input class="checkbox" id="chkall" onclick="checkall('uid[]')" type="checkbox" name="chkall"><label for="chkall">全选</label></td>
		<td  width="20%">用户名</td>
		<td  width="20%">Email</td>
		<td  width="20%">注册IP</td>
		<td  width="10%">已推荐</td>
		<td  width="10%">上次登录时间</td>
		<td  width="10%">编辑</td>
	</tr>
	
	<!--{loop $userlist $member}-->
	<tr>
        <td class="altbg2"><input class="checkbox" type="checkbox" value="{$member['uid']}" name="uid[]"></td>
        <td class="altbg2"><strong>{$member['username']}</strong></td>
        <td class="altbg2">{$member['email']}</td>
        <td class="altbg2">{$member['regip']}</td>
        <td class="altbg2">{$member['lastlogintime']}</td>
        <td class="altbg2">{if $member['elect']}<font color="Red">是</font>{else}否{/if}</td>
        <td class="altbg2"><a href="index.php?admin_user/edit/$member['uid']{$setting['seo_suffix']}">编辑</a></td>
	</tr>
	<!--{/loop}-->
	<!--{if $departstr}-->
	<tr><td colspan="7" class="altbg2" align="right">{$departstr}</td></tr>
	<!--{/if}-->
	<tr><td colspan="7" class="altbg1" align="left"><input class="button" type="button" name="elect" onclick="commenduser(1);" value="推荐为本周之星" />&nbsp;&nbsp;<input class="button" type="button" name="elect" onclick="commenduser(0);" value="取消推荐" />&nbsp;&nbsp;<input class="button" type="button" name="delete" onclick="remove();" value="删除" /></td></tr>
</table>
</form>
<br>
<!--{template footer,admin}-->
    <script type="text/javascript">
        function commenduser(type){
            if($("input[name='uid[]']:checked").length == 0){
                alert('你没有选择任何用户');
                return false;
            }
            document.userForm.action="index.php?admin_user/famous/"+type+"{$setting['seo_suffix']}";
            document.userForm.submit();
        }

        function remove(){
            if($("input[name='uid[]']:checked").length == 0){
                alert('你没有选择任何用户');
                return false;
            }
            if(confirm('确认删除该用户?此操作不可恢复!')==false){
                return false;
            }
            document.userForm.action="index.php?admin_user/remove{$setting['seo_suffix']}";
            document.userForm.submit();
        }
    </script>


